package com.sportradar.assessment.work.threads;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sportradar.assessment.work.services.ExecutionManager;

/*
 * Abstraction of (Sportradar AssessmentWork) execution thread.
 * Its behavior is based its own threadName according to the settings from resource
 * 
 * @see ConfigUtil
 */
public class ExecutionThread implements Runnable{
	
	private static Logger logger=LoggerFactory.getLogger(ExecutionManager.class);

	private String threadName;
	private ExecutionManager threadManager;
	
	public ExecutionThread(String name,ExecutionManager threadManager){
		this.threadName=name;
		this.threadManager=threadManager;
	}

	public void run() {
		try{
			threadManager.execute(this.threadName);
		}catch(Exception e){
			logger.error(e.getMessage(),e);
		}
		
	}

	
}
